<?php

namespace YouBaoLian\Application\Response;

use YouBaoLian\Http\Response;

class VehicleRevokeResponse extends Response
{

    /**
     * 核保状态
     * @var int $status
     */
    private $status = 0;

    /**
     * 核保信息
     * @var string $info
     */
    private $info = '';

    public function build(): self
    {
        parent::build();

        $this->status = $this->getBizContent('status');
        $this->info = $this->setStatus();

        return $this;
    }

    public function setStatus(): string
    {
        switch ($this->status) {
            case 41:
                return '已报价撤回';
            case 42:
                return '核保中撤回';
            case 43:
                return '核保失败撤回';
            case 44:
                return '已核保撤回';
            default:
                return '未知状态' . $this->status;
        }

    }

    /**
     * @return int
     */
    public function getStatus(): int
    {
        return $this->status;
    }

    /**
     * @return string
     */
    public function getInfo(): string
    {
        return $this->info;
    }
}
